package com.vipboot.aot.util;

import java.io.IOException;
import java.util.Locale;

public class GraalvmUtil {

    public static void changeLanguageGraalvm() throws IOException, InterruptedException {
        if (System.getProperties().getProperty("os.name").toUpperCase(Locale.ROOT).contains("WINDOWS")) {
            ProcessBuilder pb = new ProcessBuilder("cmd.exe", "/c", "chcp", "65001").inheritIO(); // 需要使用 inheritIO
            Process p = pb.start();
            p.waitFor();
            System.out.println("代码页已切换到 UTF-8 (65001)");
        }
    }
}
